package com.example.everying.service.statistics;/*
 * 项目名称: everything
 * 文件名: UserSessionService
 * 作者: 张泽阳
 * 日期: 2025/7/7
 * 描述:
 */

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.everying.model.dto.statistics.UserStatDto;
import com.example.everying.model.entity.statistics.UserSession;
import com.example.everying.utils.Result;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public interface UserSessionService extends IService<UserSession> {

    Result<?> recordLogin();

    Result<?> recordLogout();

    Result<?> averageUseTime();

    Result<?> loginCount();

    Result<?> rr1();

    Result<?> rr7();

    Result<?> onlineUserCount();

    List<String> getUserIdsByTime(LocalDateTime startTime, LocalDateTime endTime);

    int getStatCohortCount(LocalDate statDate, LocalDate cohortDate);

    List<String> getDistinctUsersByDate(LocalDate date);



    Result<?> conversionStatistics();

    Result<?> completionRate();

    Result<?> totalAmount();

    Result<?> recurrentRate();

    Result<?> repurchaseRate();

    Result<?> userLoginCount(UserStatDto userStatDto);

    Result<?> userLoginDuration(UserStatDto userStatDto);

    /**
     * 根据用户id获取用户会话信息
     * @param userId
     * @return
     */
    UserSession getUserSessionByUserId(String userId);

    Result<?> getTopTenArticle();
}
